<template>
	<view>
		<view class="uni-container">
			<uni-table ref="table" width="100%" :loading="loading" :border="border" stripe emptyText="暂无更多数据">
				<uni-tr>
					<uni-th v-for="(item,index) in headerData" :key="index" :align="item.align||'left'"
						:width="item.width||15">{{item.name}}</uni-th>
				</uni-tr>
				<uni-tr v-for="(item, index) in tableData" :key="index">
					<uni-td v-for="(ele,ex) in headerData" :key="ex" :align="item.align||'left'">
						<slot v-if="headerData[ex].solt" :name="headerData[ex].solt" :data="item" :key="ex"></slot>
						<view v-else class="value" >
							{{ item[headerData[ex].value]}}</view>
					</uni-td>

				</uni-tr>
			</uni-table>
		</view>
	</view>
</template>

<script>
	import uniTable from "@/uni_modules/uni-table/components/uni-table/uni-table.vue"
	export default {
		name: "cTable",
		components: {
			"uni-table": uniTable
		},
		props: {
			headerData: {
				type: Array,
				default: () => []
			},
			tableData: {
				type: Array,
				default: () => []
			},
			border: {
				type: Boolean,
				default: false
			}
		},
		data() {
			return {
				// 每页数据量
				pageSize: 10,
				// 当前页
				pageCurrent: 1,
				// 数据总量
				total: 0,
				loading: false
			}
		},
		onLoad() {

		},
		methods: {




		}
	}
</script>

<style scoped>
	.uni-container {
		width: 100%;
		margin: 0 auto;
	}

	::v-deep .uni-table-th {
		padding: 20rpx 20rpx 22rpx;
		display: table-cell;
		box-sizing: border-box;
		font-weight: bold;
		border-bottom: 1px #F6F6F6 solid;
		background: #F6F6F6;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		font-size: 20rpx;
		color: #000000;
		font-style: normal;
		text-transform: none;
	}
</style>